﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlReportPhanTuyen.ascx.cs" Inherits="UserControl_ControlReportPhanTuyen" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dxwpg" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraPivotGrid.Web" tagprefix="dxpgw" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<script type="text/javascript">
    function pageLoad() {

        $(".direct_margin_topbottom").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });

        $("#<%= imgBtnAdd.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });
      
       
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }

    }

</script>


<asp:UpdatePanel ID="UpdatePanel1" runat="server">

    <ContentTemplate>
   
                <div class="direct_container_right_titletop direct_colleft">
                    Báo cáo thông tin phân tuyến TDV
                </div>
                 
                <!-- Button chuc nang-->
                <div class="direct_menu_report_page direct_colleft">
                    <asp:ImageButton ID="imgBtnAdd" ToolTip="Lấy dữ liệu" onclick="imgBtnAdd_Click"  ImageUrl="~/Images/Document.png" Width="32px" Height="32px" runat="server" />
                    
                 </div>
                <!-- End Button chuc nang-->
                <div class="clear"></div>
                 <hr />
 <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            BackColor="#CCFFFF" Font-Names="Arial" 
            Width="100%">
             <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Thông tin TDV đã phân tuyến" TabIndex="0">
                 <ContentTemplate>
                  <div class="direct_container_main">
                                        <div class="direct_container_form_right">
                 <table border="0" width="100%">
                   
                    <tr>
                    <td>
                         <asp:GridView ID="grvTDV" runat="server" AutoGenerateColumns="False" 
                                        onrowcommand="grvTDV_RowCommand" 
                                        
                                         DataKeyNames="salesp_key" EnableModelValidation="True">
                                         <Columns>
                            <asp:TemplateField HeaderText="Stt">
                                <HeaderTemplate>
                                                                    STT
                                                                
                                         
                                </HeaderTemplate>
                            <ItemTemplate>
                                                                    <%# Container.DataItemIndex + 1 %>
                                                                
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="50px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Mã TDV"><HeaderTemplate>
                                                                   Mã TDV
                                                                
</HeaderTemplate>
<ItemTemplate>
                                                                  
                  <asp:Label ID="lblsalesp_key" runat="server" Text='<%# Eval("salesp_key")%>'></asp:Label>                                               
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="100px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="100px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Họ tên"><HeaderTemplate>
                                                                   Họ tên
                                                                
</HeaderTemplate>
<ItemTemplate>
                                                                   
                    <asp:Label ID="lblsalesp_name" runat="server" Text='<%# Eval("salesp_name")%>'></asp:Label>                                             
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="200px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="200px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Cấp bậc"><HeaderTemplate>
                                                                   Cấp bậc
                                                                
</HeaderTemplate>
<ItemTemplate>
                                                                   
                    <asp:Label ID="lblCapBac" runat="server" Text='<%# Eval("Description")%>'></asp:Label>                                             
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="200px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="200px" />
</asp:TemplateField>




<asp:TemplateField HeaderText="Click xem chi tiết"><HeaderTemplate>
                                                                   Click xem chi tiết
                                                                
</HeaderTemplate>
                                                                 <ItemTemplate>
                                                                    <asp:ImageButton ID="imgBtnChon" runat="server" CausesValidation="False" 
                                                                    CommandName="chon" Height="20px" ImageUrl="~/Images/check.png" />
                                                                </ItemTemplate>
                                                                <ControlStyle BackColor="White" />
                                                                <FooterStyle BackColor="White" />
                                                               <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                                                <ItemStyle HorizontalAlign="Center" BackColor="White" />
                                                            </asp:TemplateField>
</Columns>
</asp:GridView>
       
     </td>
                    </tr>
                 </table>
                  </div>
                   </div> 
                 </ContentTemplate>
            </cc1:TabPanel>
             <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Chi tiết phân khách hàng" TabIndex="1">
                <ContentTemplate>
                 <!-- Content main-->
                                    <div class="direct_container_main">
                                        <div class="direct_container_form_right">
                                            <table border="0" width="100%">
                                            
                                                <tr>
                                                    <td colspan="2" align="center">
                                                       Thông tin chi tiết phân khách hàng cho TDV :
                                                        <asp:Label ID="lblTDV" runat="server" Text=""></asp:Label>
                                                        _
                                                        <asp:Label ID="lblHotenTDV" runat="server" Text=""></asp:Label>
                                                    </td>
                                                </tr>
                                               
                                                  
                                               <tr>
                                                    <td colspan="2">
                                                    
                        <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid1" runat="server">
                 <Fields>
               
                <dxwpg:PivotGridField ID="PivotGridField2" Area="RowArea"  AreaIndex="0" Caption="Khách hàng" FieldName="CustID">
                </dxwpg:PivotGridField>
                  <dxwpg:PivotGridField ID="PivotGridField3" Area="RowArea"  AreaIndex="1" Caption="Địa chỉ" FieldName="address">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="PivotGridField11" Area="RowArea"  AreaIndex="2" Caption="Approve" FieldName="Active">
                 </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="PivotGridField7" Area="FilterArea"  AreaIndex="0" Caption="Tỉnh/Thành" FieldName="ProvinceCode">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotGridField9" Area="FilterArea"   AreaIndex="1" Caption="Quận/Huyện" FieldName="QuanHuyen">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="PivotGridField10" Area="FilterArea"  AreaIndex="2" Caption="Khách hàng thuộc NPP" FieldName="NPPKH">
                </dxwpg:PivotGridField>
               
                 <dxwpg:PivotGridField ID="PivotGridField12" Area="FilterArea"   AreaIndex="3" Caption="Tính doanh số cho" FieldName="ToSalesKey">
                </dxwpg:PivotGridField>
                 <dxwpg:PivotGridField ID="PivotGridField13" Area="FilterArea"   AreaIndex="4" Caption="Chỉ số tính doanh số" FieldName="Rate">
                </dxwpg:PivotGridField>
               
                </Fields>
                <OptionsPager Visible="False">
               </OptionsPager>
               <OptionsView ShowColumnGrandTotals="False" ShowRowGrandTotals="False" ShowRowTotals="False" ShowColumnTotals="False" />
        </dxwpg:ASPxPivotGrid>
                                                    </td>
                                               </tr>
                                                
                                               
                                            </table>
                                        </div>
                                    </div>
                                    <!-- EndContent main-->
                </ContentTemplate>
            </cc1:TabPanel>
             <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="Chi tiết phân mặt hàng" TabIndex="2">
                <ContentTemplate>
                         <!-- Content main-->
                                    <div class="direct_container_main">
                                        <div class="direct_container_form_right">
                                            <table border="0" width="100%">
                                            
                                                <tr>
                                                    <td colspan="2" align="center">
                                                       Thông tin chi tiết phân mặt hàng cho TDV :
                                                        <asp:Label ID="lblTDV1" runat="server" Text=""></asp:Label>
                                                        _
                                                        <asp:Label ID="lblHotenTDV1" runat="server" Text=""></asp:Label>
                                                    </td>
                                                </tr>
                                               
                                                  
                                               <tr>
                                                    <td colspan="2">
                                                             <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid2" runat="server">
                                                        <Fields>
                                                             <dxwpg:PivotGridField ID="PivotGridField4" Area="RowArea"  AreaIndex="0" Caption="Tên hàng theo Fimex" FieldName="Itemkey">
                                                            </dxwpg:PivotGridField>
                                                            <dxwpg:PivotGridField ID="PivotGridField1" Area="FilterArea"  AreaIndex="2" Caption="Tên hàng theo NPP" FieldName="ItemkeyNPP">
                                                            </dxwpg:PivotGridField>
                                                             <dxwpg:PivotGridField ID="PivotGridField6" Area="FilterArea" 
                                                             AreaIndex="0" Caption="Gam hàng" FieldName="Gam">
                                                            </dxwpg:PivotGridField>
                                                             
                                                             <dxwpg:PivotGridField ID="PivotGridField5" Area="RowArea"  AreaIndex="4" Caption="Approve" FieldName="Active">
                                                            </dxwpg:PivotGridField>
               
                                                            <dxwpg:PivotGridField ID="PivotGridField8" Area="FilterArea"  AreaIndex="1" Caption="Nhóm sản phẩm" FieldName="GroupSKU">
                                                             </dxwpg:PivotGridField>
                                                        </Fields>
                                                 <OptionsPager Visible="False">
                                                 </OptionsPager>
                                                  <OptionsView ShowColumnGrandTotals="False" ShowRowGrandTotals="False" ShowRowTotals="False" ShowColumnTotals="False" />
                                                        </dxwpg:ASPxPivotGrid>
                                                      </td>
                                               </tr>
                                                
                                               
                                            </table>
                                        </div>
                                    </div>
                                    <!-- EndContent main-->
                </ContentTemplate>
            </cc1:TabPanel>
         </cc1:TabContainer>
                 <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>    
    </ContentTemplate>
</asp:UpdatePanel>